CREATE TABLE `SRAnalytics`.`MsgLiveSurfaceDetail` (
`ekey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None',
`ekey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','ESX','ANY','CXE','DXE','NXAM','NXBR','NXDUB','NXLS','NXLDN','NXML','NXMLT','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None',
`ekey_tk` VARCHAR(12) NOT NULL DEFAULT '',
`ekey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
`ekey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`ekey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`surfaceType` ENUM('None','Live','PrevDay','Interp','Close','Test') NOT NULL DEFAULT 'None',
`ticker_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'underlying stock key that this option expiration attaches to',
`ticker_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','ESX','ANY','CXE','DXE','NXAM','NXBR','NXDUB','NXLS','NXLDN','NXML','NXMLT','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'underlying stock key that this option expiration attaches to',
`ticker_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'underlying stock key that this option expiration attaches to',
`fkey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'underlying future key (if any)',
`fkey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','ESX','ANY','CXE','DXE','NXAM','NXBR','NXDUB','NXLS','NXLDN','NXML','NXMLT','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'underlying future key (if any)',
`fkey_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'underlying future key (if any)',
`fkey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'underlying future key (if any)',
`fkey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'underlying future key (if any)',
`fkey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'underlying future key (if any)',
`uPrcDriverKey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'underlier driver key',
`uPrcDriverKey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','ESX','ANY','CXE','DXE','NXAM','NXBR','NXDUB','NXLS','NXLDN','NXML','NXMLT','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None' COMMENT 'underlier driver key',
`uPrcDriverKey_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'underlier driver key',
`uPrcDriverKey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'underlier driver key',
`uPrcDriverKey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'underlier driver key',
`uPrcDriverKey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'underlier driver key',
`uPrcDriverType` ENUM('None','Stock','Future','Option','MLeg') NOT NULL DEFAULT 'None' COMMENT 'underlier driver key type (stock or future)',
`ddiv` FLOAT NOT NULL DEFAULT 0 COMMENT '(expected) cumulative discrete dividend $ amounts prior to expiration',
`ddivPv` FLOAT NOT NULL DEFAULT 0 COMMENT '(expected) cumulative npv of discrete dividend $ amounts prior to expiration (SR global rate curve)',
`ddivSource` ENUM('None','Announced','Forecast') NOT NULL DEFAULT 'None' COMMENT 'Forecast if any of the dividends prior to expiry are forecast rather than announced',
`symbolRatio` FLOAT NOT NULL DEFAULT 0 COMMENT 'underlier price ratio (usually 1.0 or a multi-hedge option price ratio; if one exists)',
`exType` ENUM('None','American','European','Asian','Cliquet') NOT NULL DEFAULT 'None' COMMENT 'exercise type (American or European)',
`modelType` ENUM('None','LogNormalExact','NormalExact','LogNormalApprox','NormalApprox') NOT NULL DEFAULT 'None' COMMENT 'option pricing model used for price calcs (Normal, LogNormal, etc.)',
`priceType` ENUM('None','Equity','Future') NOT NULL DEFAULT 'None' COMMENT 'Equity has independent sdiv and rate, Future has sdiv = rate',
`earnCnt` FLOAT NOT NULL DEFAULT 0 COMMENT 'number of qualifying earnings events prior to expiration [can be fractional] (from StockEarningsCalendar)',
`earnCntAdj` FLOAT NOT NULL DEFAULT 0 COMMENT 'number of qualifying earnings events prior to expiration [adjusted] (from StockEarningsCalendar + LiveSurfaceTerm)',
`moneynessType` ENUM('None','PctStd','LogStd','NormStd') NOT NULL DEFAULT 'None' COMMENT 'moneyness (xAxis) convention',
`priceQuoteType` ENUM('None','Price','Vol') NOT NULL DEFAULT 'None' COMMENT 'Price or Vol',
`atmVolHist` FLOAT NOT NULL DEFAULT 0 COMMENT 'historical realized volatility (includes eMoveHist x earnCntAdj adjustment). Note that this is the default atmVol if no implied markets existed previous day.',
`atmCenHist` FLOAT NOT NULL DEFAULT 0 COMMENT 'censored (earnings events removed) historical realized volatility. Trailing periods is 2x forward time to expiration. From HistoricalVolatility(windowType=hlCen).mv_nnn',
`uBetaHist` FLOAT NOT NULL DEFAULT 0 COMMENT 'beta (this underlier vs basis underlier; T + 1 week)',
`eMove` FLOAT NOT NULL DEFAULT 0 COMMENT 'implied earnings move (from LiveSurfaceTerm)',
`eMoveHist` FLOAT NOT NULL DEFAULT 0 COMMENT 'historical earnings move (avg of trailing 8 moves). From StockEarningsCalendar.eMoveHist',
`minXAxis` FLOAT NOT NULL DEFAULT 0 COMMENT 'minimum xAxis value; left most point with a valid supporting strike',
`maxXAxis` FLOAT NOT NULL DEFAULT 0 COMMENT 'maximum xAxis value; right most point with a valid supporting strike',
`atmPhi` FLOAT NOT NULL DEFAULT 0 COMMENT 'surface phi @ xAxis = 0',
`atmRho` FLOAT NOT NULL DEFAULT 0 COMMENT 'surface rho @ xAxis = 0',
`atmVega` FLOAT NOT NULL DEFAULT 0 COMMENT 'surface vega @ xAxis = 0',
`uPrcRatio` DOUBLE NOT NULL DEFAULT 0 COMMENT 'uPrcAdj = uPrc * uPrcRatioFit',
`pwidth` FLOAT NOT NULL DEFAULT 0 COMMENT 'minimum mkt premium width',
`vwidth` FLOAT NOT NULL DEFAULT 0 COMMENT 'minimum mkt volatility width',
`cCnt` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'num call strikes in base fit',
`pCnt` SMALLINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'num put strikes in base fit',
`hasBracketMin` ENUM('None','Yes','No') NOT NULL DEFAULT 'None',
`surfaceSkewType` ENUM('None','Param1','Param2','Param3','Param4') NOT NULL DEFAULT 'None',
`cBidMiss` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of call bid violations (surface outside the market)',
`cAskMiss` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of call ask violations (surface outside the market)',
`pBidMiss` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of put bid violations',
`pAskMiss` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'number of put ask violations',
`fitScoreT0` FLOAT NOT NULL DEFAULT 0,
`fitScoreT1` FLOAT NOT NULL DEFAULT 0,
`cumFitScoreT0` FLOAT NOT NULL DEFAULT 0,
`cumFitScoreT1` FLOAT NOT NULL DEFAULT 0,
`fitCounter` INT NOT NULL DEFAULT 0 COMMENT 'number of fit/count passes (current trade date / market open)',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
PRIMARY KEY USING HASH (`ekey_tk`,`ekey_yr`,`ekey_mn`,`ekey_dy`,`ekey_at`,`ekey_ts`,`surfaceType`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='LiveSurfaceDetail (surfaceType = \'Live\') records are computed and publish continuously during trading hours and represent a current best implied volatility market fit details.\nSurfaceType = \'PriorDay\' records contain the `closing surface record from the prior trading period (usually from just before the last main session close).';